import React, { Component } from 'react'
import { connect } from 'react-redux';
import { fetchUser } from '@/action/userAction';
import TableList from './tableList';

// eslint-disable-next-line
class UserManage extends Component {

    componentDidMount() {
        const { dispatch } = this.props;
        dispatch(fetchUser());
    }

    render() {
        const { userData } = this.props;
        return (
            <div>
                <TableList userData={userData} />
            </div>
        )
    }
}

const mapStateToProps = state => ({
    userData: state.userData,
})

export default connect(mapStateToProps)(UserManage);
